package com.cg.client;

import com.cg.client.impl.SaleClientImpl;
import com.cg.dto.CreateSalePlanDto;
import com.cg.dto.ForecastPageDto;
import com.cg.dto.Result;
import com.cg.dto.SalePlanPageDto;
import com.cg.entity.User;
import com.cg.vo.QuerySalePlanVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "sale-provider",fallback = SaleClientImpl.class)
public interface SaleClient {

    /**
     * 销售计划管理列表
     */
    @PostMapping("/salePlan/list")
    public Result<Map<String,Object>> list(@RequestBody SalePlanPageDto salePlanPageDto);


    /**
     * 创建销售计划
     */
    @PostMapping("/salePlan/createSalePlan")
    public Result createSalePlan(@RequestBody CreateSalePlanDto createSalePlanDto);


    /**
     * 查询销售计划详细信息
     */
    @GetMapping("/salePlan/querySalePlan")
    public Result<QuerySalePlanVo> querySalePlan(@RequestParam("salePlanId") Integer salePlanId);


    /**
     * 加载所有的待处理人列表
     */
    @GetMapping("/salePlan/pendingList")
    public Result<List<User>> pendingList(@RequestParam("userId") Integer userId);


    /**
     * 提交销售计划
     */
    @PostMapping("/salePlan/submitSalePlan")
    public Result submitSalePlan(@RequestBody CreateSalePlanDto createSalePlanDto);


    /**
     * 打回销售计划，通过，作废操作
     */
    @PostMapping("/salePlan/passSalePlan")
    public Result passSalePlan(@RequestBody CreateSalePlanDto createSalePlanDto);


    /**
     * 删除销售计划
     */
    @PostMapping("/salePlan/removeSalePlan")
    public Result removeSalePlan(@RequestBody CreateSalePlanDto createSalePlanDto);


    /**
     * 查询销售预测信息列表
     */
    @PostMapping("/forecast/list")
    public Result<Map<String,Object>> list(@RequestBody ForecastPageDto forecastPageDto);
}
